package bombermanGame;

import org.newdawn.slick.Animation;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.geom.Vector2f;

public class Bomberman {
	
	private Image standLeftimage;
	private Image standRightimage;
	private Image standUpimage;
	private Image standDownimage;
	private Vector2f position;
	private Vector2f direction;
	private Animation upAnimation;
	private Animation downAnimation;
	private Animation leftAnimation;
	private Animation rightAnimation;
	
	
	public Bomberman() throws SlickException {
		standLeftimage = new Image("/images/bomberman/player1/left1.gif");
		standRightimage = new Image("/images/bomberman/player1/right1.gif");
		standUpimage = new Image("/images/bomberman/player1/up1.gif");
		standDownimage = new Image("/images/bomberman/player1/down1.gif");
		
		position = new Vector2f(100, 200);
		direction = new Vector2f();
		upAnimation = new Animation();
		downAnimation = new Animation();
		leftAnimation = new Animation();
		rightAnimation = new Animation();
		
		initAnimations();
	}
	
	
	public Image getStandLeftimage() {
		return standLeftimage;
	}



	public void setStandLeftimage(Image standLeftimage) {
		this.standLeftimage = standLeftimage;
	}



	public Image getStandRightimage() {
		return standRightimage;
	}



	public void setStandRightimage(Image standRightimage) {
		this.standRightimage = standRightimage;
	}



	public Image getStandUpimage() {
		return standUpimage;
	}



	public void setStandUpimage(Image standUpimage) {
		this.standUpimage = standUpimage;
	}



	public Image getStandDownimage() {
		return standDownimage;
	}



	public void setStandDownimage(Image standDownimage) {
		this.standDownimage = standDownimage;
	}



	public Vector2f getPosition() {
		return position;
	}
	
	
	public Animation getUpAnimation() {
		return upAnimation;
	}

	public void setUpAnimation(Animation upAnimation) {
		this.upAnimation = upAnimation;
	}

	public Animation getDownAnimation() {
		return downAnimation;
	}

	public void setDownAnimation(Animation downAnimation) {
		this.downAnimation = downAnimation;
	}

	public Animation getLeftAnimation() {
		return leftAnimation;
	}

	public void setLeftAnimation(Animation leftAnimation) {
		this.leftAnimation = leftAnimation;
	}

	public Animation getRightAnimation() {
		return rightAnimation;
	}

	public void setRightAnimation(Animation rightAnimation) {
		this.rightAnimation = rightAnimation;
	}

	public void setDirectionY(float newY){
		direction.y = newY;
	}
	
	public void setDirectionX(float newX){
		direction.x = newX;
	}
	
	
	public void initAnimations() throws SlickException{
		upAnimation.addFrame(new Image("/images/bomberman/player1/up1.gif"), 200);
		upAnimation.addFrame(new Image("/images/bomberman/player1/up2.gif"), 200);
		upAnimation.addFrame(new Image("/images/bomberman/player1/up3.gif"), 200);
		upAnimation.addFrame(new Image("/images/bomberman/player1/up4.gif"), 200);
		
		downAnimation.addFrame(new Image("/images/bomberman/player1/down1.gif"), 200);
		downAnimation.addFrame(new Image("/images/bomberman/player1/down2.gif"), 200);
		downAnimation.addFrame(new Image("/images/bomberman/player1/down3.gif"), 200);
		downAnimation.addFrame(new Image("/images/bomberman/player1/down4.gif"), 200);
		
		leftAnimation.addFrame(new Image("/images/bomberman/player1/left1.gif"), 200);
		leftAnimation.addFrame(new Image("/images/bomberman/player1/left2.gif"), 200);
		leftAnimation.addFrame(new Image("/images/bomberman/player1/left3.gif"), 200);
		leftAnimation.addFrame(new Image("/images/bomberman/player1/left4.gif"), 200);
		
		rightAnimation.addFrame(new Image("/images/bomberman/player1/right1.gif"), 200);
		rightAnimation.addFrame(new Image("/images/bomberman/player1/right2.gif"), 200);
		rightAnimation.addFrame(new Image("/images/bomberman/player1/right3.gif"), 200);
		rightAnimation.addFrame(new Image("/images/bomberman/player1/right4.gif"), 200);
	}
	
	public void move(){
		Vector2f newPosition = new Vector2f();
		
		newPosition = position.add(direction);
		position = newPosition;
	}

}
